/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gitee.fdc.base.dao;

import com.gitee.fdc.base.entity.TreeEntity;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gitee.fdc.mapper.SbbsMapper;
import java.io.Serializable;

/**
 *
 * @author qskj
 */
public interface BaseTreeDao<T extends TreeEntity, ID extends Serializable> extends SbbsMapper<T> {

    public T findById(ID id);
    public List<T> findByPid(ID pid);
    
    /**
     * 找到所有子节点
     *  
     * @param entity
     * @return
     */
    public List<T> findByParentIdsLike(String pids);

    /**
     * 更新所有父节点字段
     *
     * @param entity
     * @return
     */
    public int batchReplacePidsPath(@Param("oldPath")String oldPath,@Param("newPath")String newPath);

}
